with Ada.Strings.Unbounded;

package body Pair is

   package SU renames Ada.Strings.Unbounded;

   function Create (Key : String; Value : String) return Pair_Type is
      Pair : Pair_Type;
   begin
      Pair.Key := SU.To_Unbounded_String (Key);
      Pair.Value := SU.To_Unbounded_String (Value);
      return Pair;
   end Create;

   procedure Set_Key (Pair : in out Pair_Type; Key : String) is
   begin
      Pair.Key := SU.To_Unbounded_String (Key);
   end Set_Key;

   function Key (Pair : Pair_Type) return String is
   begin
      return SU.To_String (Pair.Key);
   end Key;

   procedure Set_Value (Pair : in out Pair_Type; Value : String) is
   begin
      Pair.Value := SU.To_Unbounded_String (Value);
   end Set_Value;

   function Value (Pair : Pair_Type) return String is
   begin
      return SU.To_String (Pair.Value);
   end Value;

   function "=" (First : Pair_Type; Second : Pair_Type) return Boolean is
      use SU;
   begin
      return (First.Key = Second.Key) and (First.Value = Second.Value);
   end "=";

end Pair;
